﻿using EMRView.Extensions.Extension;
using EMRView.Extensions.HCAttribute;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace EMRView.Extensions.Command.StandardCommand.Insert
{
    [Command(CommandType.插入, "AddEdit", "添加可编辑文本元素")]
    public class AddEditCommand : BaseCommand
    {
        public override Icon CommandIcon => EMRView.Extensions.Properties.HCResource.输入域;

        public override object Execute(HCEmrView _view, bool showDefaultUI = true, params object[] para)
        {
            Frm_AddEdit input = new Frm_AddEdit();

            if (input.ShowDialog() == DialogResult.OK)
            {
                _view.AddEdit(new DeEditSetting
                {
                    EIndex = input.EIndex,
                    EName = input.EName,
                    EWidth = input.EWidth,
                    IsBottomBorder = input.IsBottomBorder,
                    IsLeftBorder = input.IsLeftBorder,
                    IsRightBorder = input.IsRightBorder,
                    IsTopBorder = input.IsTopBorder,
                    PrintOnlyText = input.PrintOnlyText
                });
            }
            return null;
        }

        public override void InitControl(object control)
        {

        }
    }
}
